﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Matriculex.UI.Helpers
{
    public static class MatriculexUIHelper
    {
        public static string ShowErrorMessage(this HtmlHelper helper)
        {
            var error = helper.ViewData["error"] ?? helper.ViewContext.TempData["error"];
            if (error == null) return String.Empty;

            return string.Format("<p class=\"error\">{0}</p>", helper.Encode(error));
        }

        public static string ShowMessage(this HtmlHelper helper)
        {
            var message = helper.ViewData["message"] ?? helper.ViewContext.TempData["message"];
            if (message == null) return String.Empty;

            return string.Format("<p class=\"message\">{0}</p>", helper.Encode(message));
        }
    }
}
